export class PokerPrefab {

    public static Color_Type = {
        fangkuai: 0,
        meihua: 1,
        hongtao: 2,
        heitao: 3,
        wang: 4,
    }


    public static Lai_Data: number = -1
    public static lai_check_cards: Array<number> = [
        0x4f, 0x31, 0x3D, 0x3C, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3A, 0x3B,
    ]

    //10进制对应值为
    // [
    //      [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13],
    //      [17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29], 
    //      [33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45], 
    //      [49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61],
    //      [78, 79],
    //  ]

    //一副扑克牌
    //扑克定义 一个字节，前4位花色，后4位数字
    public static a_deck_cards: Array<number> = [
        0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D,    //方块 A - K
        0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D,    //梅花 A - K
        0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2A, 0x2B, 0x2C, 0x2D,    //红桃 A - K
        0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3A, 0x3B, 0x3C, 0x3D,    //黑桃 A - K
        0x4e, 0x4f,                                                                      //小王,大王  
    ]


    // 获取poker的值，1，2，3，4，5，6，7，8，9，a,b,c,d
    public static getPokerValue(pokerData: number): number {
        if (isNaN(pokerData)) {
            pokerData = 0
        }
        return pokerData & 0x0f;
    }


    //获取poker花色 0,1,2,3,4
    public static getPokerColor(pokerData: number): number {
        if (isNaN(pokerData)) {
            pokerData = 0
        }
        return (pokerData & 0xF0) >> 4;
    }


}